﻿@model LanDBom.Models.parice

@{
    ViewBag.Title = "Edit";
}

<h2>编辑原料信息</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <fieldset class="boun">
        <table class="form-horizontal table-app" cellpadding="5">
            @Html.ValidationSummary(true, "", new { @class = "text-danger" })
            @Html.HiddenFor(model => model.PA_ID)
            <tr class="form-group">
                <td>@Html.Label("品牌", htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.EditorFor(model => model.PA_Pinpai, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_Pinpai, "", new { @class = "text-danger" })
                </td>
                <td> @Html.Label("种类", htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.EditorFor(model => model.PA_ZhongL, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_ZhongL, "", new { @class = "text-danger" })
                </td>
            </tr>
            <tr class="form-group">
                <td>@Html.Label("平方克重", htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.EditorFor(model => model.PA_KZ, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_KZ, "", new { @class = "text-danger" })
                </td>
                <td> @Html.Label("吨重", htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.EditorFor(model => model.PA_T, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_T, "", new { @class = "text-danger" })
                </td>
            </tr>
            <tr class="form-group">
                <td>@Html.Label("更新时间", htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.EditorFor(model => model.PA_Time, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_Time, "", new { @class = "text-danger" })
                </td>
                <td> @Html.Label("类别", htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.EditorFor(model => model.PA_LengBie, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_LengBie, "", new { @class = "text-danger" })
                </td>
            </tr>
            <tr class="form-group">
                <td>@Html.Label("分类", htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.DropDownList("PA_Shuxing", null, htmlAttributes: new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.mateial.MA_fne, "", new { @class = "text-danger" })
                </td>
                <td style="display:none">@Html.Label("编号", htmlAttributes: new { @class = "control-label " })</td>
                <td style="display:none" >
                    @Html.EditorFor(model => model.PA_ID, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_ID, "", new { @class = "text-danger" })
                </td>
            </tr>
            <tr class="form-group">
                <td class="col-md-offset-2 ">
                    <input type="submit" value="修改" class="btn-sm btn-default" id="btn_qd"/>
                </td>
                <td><button class="btn-sm btn-default">@Html.ActionLink("返回列表", "Index", "Formations", new { @style = "color:#000" })</button> </td>
            </tr>
        </table>
    </fieldset>

}
@section scripts
{
    <script src="~/Scripts/jquery-3.4.1.min.js"></script>
    <script src="~/Scripts/bootstrap.min.js"></script>
    <script>
        $(function () {
            function BF() {
                var paid = $("#PA_ID").val()
                alert(paid)
                $.ajax({
                    url: '/Procure/AddLanjilu_2',
                    type: 'POST',
                    data: { "paid": paid },
                    success: function (data) {

                    },
                    error: function () {
                        alert('Request Error');
                    }
                })
            }
            function xuigai() {
                var paid = $("#PA_ID").val()
                $.ajax({
                    url: '/Procure/changegy',
                    type: 'POST',
                    data: { "paid": paid },
                    success: function (data) {

                    },
                    error: function () {
                        alert('Request Error');
                    }
                })
            }
            $(document).on("click", "#btn_qd", function () {
                BF()
                xuigai()
            })
        })
    </script>
}
